export default{
	data(){
		return {
			code:''
		}
	},
	onShow() {
		this.getLoginCode()
	},
	methods:{
		getUserInfo({detail}){
			uni.getUserProfile({
				desc:"请求获取用户信息",
				lang:"zh_CN",
				success: detail => {
					detail.code = this.code;
					this.registerCallback(detail)
				}
			})
		},
		getLoginCode(){
			// #ifdef MP-WEIXIN
				return new Promise((resolve,reject)=>{
					uni.login({
						success: ({code}) => {
							this.code = code;
							resolve(code)
						},
						fail:reject
					})
				})
			// #endif
		}
	}
}